﻿@model IEnumerable<Bieb.Web.Models.Books.ViewBookModel>

<table class="table table-bordered table-condensed table-striped table-hover">
    <tr>
        <th>@BiebResources.BookStrings.TitleHeader</th>
        <th>@BiebResources.BookStrings.PeopleInvolved</th>
        <th>@BiebResources.BookStrings.TypeHeader</th>
        <th>@BiebResources.BookStrings.LibraryStatusHeader</th>
    </tr>

@foreach (var book in Model) 
{
    <tr>
        <td>
            @Html.ActionLink(book.Title, "Details", new { controller = "Books", id = book.Id })
            @if (!string.IsNullOrWhiteSpace(book.Subtitle))
            {
                <br />
                @book.Subtitle
            }
        </td>
        <td>@Html.Raw(string.Join(", ", book.CoverPeople.Select(person => Html.ActionLink(person.Text, "Details", new { id = person.Id, controller = "People" }))))</td>
        <td>@book.BookType</td>
        <td>@book.LibraryStatus</td>
    </tr>
}
</table>